package com.jorado.ognl;

/**
 * @Auther: len.zhang
 * @Date: 2019/8/14 16:33
 * @Description:
 */
public class ExpressionResult {

    private Object value;
    private long elapsed;
    private boolean ok;
    private String error;

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public long getElapsed() {
        return elapsed;
    }

    public void setElapsed(long elapsed) {
        this.elapsed = elapsed;
    }

    public boolean isOk() {
        return ok;
    }

    public void setOk(boolean ok) {
        this.ok = ok;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"value\":")
                .append(value);
        sb.append(",\"elapsed\":")
                .append(elapsed);
        sb.append(",\"ok\":")
                .append(ok);
        sb.append(",\"error\":\"")
                .append(error).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
